<%@ page pageEncoding="utf-8" language="java" %>
<%@ include file="/WEB-INF/views/common/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<%@ include file="/WEB-INF/views/common/head.jsp"%>
	<title>后台管理系统 - stoat</title>
	
	<style type="text/css">
		.dataTables_paginate .disabled{color:#fff!important;background:#424f5d!important;}
	</style>
	
</head>
<body>
	<sys:msg msgObj="${msg}"/>
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i> 首页 
		<span class="c-gray en">&gt;</span> 图片管理 <span class="c-gray en">&gt;</span> 图片列表 
		<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont btn-refresh">&#xe68f;</i></a></nav>
		<div class="page-container">
			<div class="mt-20">
				 <!--只有将表单的enctype设置为multipart/form-data，才能实现文件上传；表单enctype的默认值为：application/x-www-form-urlencoded-->
	            <!--只有POST方法才会被解析为文件上传请求    -->
	            <form action="${ctx }/cms/picture/fileupload" method="post" enctype="multipart/form-data">
	                <!-- 不知道为啥，type="file"这一标签必须同时添加name属性，否则在处理上传时，无法检测到上传文件 -->
	                图片1：<input type="file" name="myfiles"/>
	           图片2：     <input type="file" name="myfiles"/>
	                <input type="submit" value="上传"/>                 
	            </form>
	            <p><font color="red">上传文件大小限制在1M之内</font></p>
			</div>
		</div>
		
		
		<img alt="" src="${ctx }/WEB-INF/upload/043.jpg">
		<img alt="" src="${ctx }/WEB-INF/upload/046.jpg">
	
	
	<%@ include file="/WEB-INF/views/common/footer.jsp"%>
	
	<script src="${ctxStatic}/lib/layer/3.0.1/layer.js" type="text/javascript"></script>
	<script src="${ctxStatic}/lib/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
	<script type="text/javascript">

		function page(n,s){
			if(n) $("#pageNum").val(n);
			if(s) $("#pageSize").val(s);
			$("#searchForm").submit();
	    	return false;
	    }
		
		/* 用户-添加 */
		function user_add(title,url){
			var index = layer.open({
				type: 2,
				title: title,
				content: url
			});
			layer.full(index);
		}
		
		//修改
		function user_edit(title, url){
			var index = layer.open({
				type: 2,
				title: title,
				content: url
			});
			layer.full(index);
		}
		
		//删除
		function user_del(id){
			layer.confirm('您确定需要删除这条信息吗？', {
			  btn: ['确定','取消'] //按钮
			}, function(){
			  location.href = ctx + "/sys/user/del/"+id;
			});
		}
		
		//批量删除
		function datadel(){
			var _list = [];
			var index = 0;	
			$("#tlist input[name='itemId']").each(function(){
				if($(this)[0].checked==true){
					console.log($(this)[0].value);
					_list[index++] = $(this)[0].value;
				}
			});
			if(_list.length == 0 ){
				layer.msg('请选择需要删除的信息');
				return;
			} else {
				layer.confirm('您确定需要删除吗？', {
					  btn: ['确定','取消'] //按钮
					}, function(){
					  //location.href = ctx + "/sys/user/datadel?ids="+_list;
					  var url = ctx + "/sys/user/datadel?random="+Math.random();
						$.ajax({
					    	type: "post",
					        url: url,
					        data:{ids:_list},
					        async: false,
					        traditional: true,
					        success: function(data){
					        	if(data=='1'){
					        		layer.msg('删除成功');
					        		location.href = ctx + "/sys/user/list";
					        	} else {
					        		layer.msg('删除失败');
					        	}
							}
						});
					});
			}
		}
	</script>
</body>
</html>